//
//  HandData.m
//  DolphinMusic
//
//  Created by dllo on 15/3/27.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HandData.h"

@implementation HandData

+ (void)handDataWithAddress:(NSString *)str complition:(void (^)(FMAlbum *album))block
{
    [NetHandler getDataWithUrl:str completion:^(id dict) {
        
        NSDictionary *dic = [dict objectForKey:@"album"];
        
        FMAlbum *album = [[FMAlbum alloc] init];
        
        album.albumID = [[dic objectForKey:@"albumId"] stringValue];
        album.title = [dic objectForKey:@"title"];
        album.albumCoverUrl290 = [dic objectForKey:@"coverSmall"];
        
        NSNumber *playCount = [dic objectForKey:@"playTimes"];
        album.playCounts = [NSString stringWithFormat:@"%.1f万", [playCount floatValue] / 10000];
        
        album.trackCounts = [[dic objectForKey:@"tracks"] stringValue];
        block(album);
        [album release];
    }];
}

@end
